/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Clases;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author pablo
 */
@Entity
@Table(catalog = "Corrector_URJC", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CursoPractica.findAll", query = "SELECT c FROM CursoPractica c"),
    @NamedQuery(name = "Cursopractica.findAllByIdCursoFK", query = "SELECT c FROM CursoPractica c WHERE c.idCursoFK = :idcursofk"),
    @NamedQuery(name = "CursoPractica.findByIdCursoPractica", query = "SELECT c FROM CursoPractica c WHERE c.idCursoPractica = :idCursoPractica")})
public class CursoPractica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer idCursoPractica;
    @JoinColumn(name = "idPracticaFK", referencedColumnName = "idPractica")
    @ManyToOne
    private Practica idPracticaFK;
    @JoinColumn(name = "idCursoFK", referencedColumnName = "idCurso")
    @ManyToOne
    private Curso idCursoFK;

    public CursoPractica() {
    }

    public CursoPractica(Integer idCursoPractica) {
        this.idCursoPractica = idCursoPractica;
    }

    public Integer getIdCursoPractica() {
        return idCursoPractica;
    }

    public void setIdCursoPractica(Integer idCursoPractica) {
        this.idCursoPractica = idCursoPractica;
    }

    public Practica getIdPracticaFK() {
        return idPracticaFK;
    }

    public void setIdPracticaFK(Practica idPracticaFK) {
        this.idPracticaFK = idPracticaFK;
    }

    public Curso getIdCursoFK() {
        return idCursoFK;
    }

    public void setIdCursoFK(Curso idCursoFK) {
        this.idCursoFK = idCursoFK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCursoPractica != null ? idCursoPractica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CursoPractica)) {
            return false;
        }
        CursoPractica other = (CursoPractica) object;
        if ((this.idCursoPractica == null && other.idCursoPractica != null) || (this.idCursoPractica != null && !this.idCursoPractica.equals(other.idCursoPractica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Clases.CursoPractica[ idCursoPractica=" + idCursoPractica + " ]";
    }
    
}
